import {FormSchema} from '@/components/Form';


export interface AnchorDatum {
    arppu: number;
    arpu: number;
    dayActivePeople: number;
    dayRechargeAmount: number;
    dayRechargePeople: number;
    dayRegisterPeople: number;
    profits: number;
    todayDate: string;
    totalPayRate: number;
    totalRechargeMoney: number;
    totalRechargePeople: number;
    totalRegisterPeople: number;
}

export interface AnchorInfo {
    adveristCost: number;
    anchorId: number;
    anchorName: string;
    chanId: string;
    createTime: string;
    liveTime: string;
    updateTime: string;
}

export const columns = [
    {
        title: '日期',
        key: 'todayDate',
        width:100
    },
    {
        title: '主播名称',
        key: 'anchorName',
    },
    {
        title: '渠道标识',
        key: 'chanId',
    },
    {
        title: '广告成本',
        key: 'adveristCost',
    },
    {
        title: '推广人数',
        key: 'totalRegisterPeople',
    },
    {
        title: '总充值人数',
        key: 'totalRechargePeople',
    },
    {
        title: '今日注册人数',
        key: 'dayRegisterPeople',
    },
    {
        title: '活跃人数',
        key: 'dayActivePeople',
    },
    {
        title: '今日充值人数',
        key: 'dayRechargePeople',
    },
    {
        title: '今天充值金额',
        key: 'dayRechargeAmount',
    },
    {
        title: '总充值金额',
        key: 'totalRechargeMoney',
    },
    {
        title: '总付费率',
        key: 'totalPayRate',
    },
    {
        title: 'ARPU',
        key: 'arpu',
    },
    {
        title: 'ARPPU',
        key: 'arppu',
    },
    {
        title:"利润",
        key:'profits',
        render:(row)=>{
            return row.profits.toFixed(2)
        }
    }
];

export const fromSchema: FormSchema[] = [
    {
        field: 'anchorName',
        labelMessage: '主播名称',
        label: '主播名称',
        componentProps: {
            placeholder: '主播名称',
        },
        rules: [{required: true, message: '主播名称', trigger: ['blur']}],
        slot:'anchorSelect'
    },
    {
        field: 'chanId',
        label: '渠道',
        defaultValue: '',
        componentProps: {
            placeholder: '请选择渠道',
        },
        slot: "chanSelect"
    },
    {
        field: 'makeDate',
        label: '日期',
        defaultValue: null,
        componentProps: {
          clearable: true,
        },
        slot: "makeDate"
    },
];

